package com.xnyzc.lhy.finance.controller.wallet;


import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.finance.service.wallet.IOaDWalletRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 用户钱包记录表 前端控制器
 * </p>
 *
 * @author cuixiaojian
 * @since 2019-10-16
 */
@RestController
@RequestMapping("/finance/oa-dwallet-record")
public class OaDWalletRecordController {

    @Autowired
    private IOaDWalletRecordService iOaDWalletRecordServicea;

    /**
     * 保存钱包变动记录
     * @param driverId 司机ID
     * @param amount 钱
     * @param date 当期时间
     * @param recordType 变动类型
     * @param transactionSerialNo 交易流水号
     * @param amountRemark 备注
     * @return Integer
     */
    @PostMapping("saveDriverWalletRecord")
    public Integer saveDriverWalletRecord(
            @RequestParam("driverId") Long driverId,
            @RequestParam("amount") BigDecimal amount,
            @RequestParam("date") Date date,
            @RequestParam("recordType") Integer recordType,
            @RequestParam("transactionSerialNo") String transactionSerialNo,
            @RequestParam("amountRemark") String amountRemark,
            @RequestParam("tag") String tag
    ) {
        return iOaDWalletRecordServicea.saveWalletRecord(driverId, amount, date, recordType, transactionSerialNo, amountRemark, tag);
    }

}
